import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from '@cool-midway/core';
import { Column } from 'typeorm';

/**
 * 描述
 */
@EntityModel('weibo_comments')
export class WeiboCommentsEntity extends BaseEntity {
  @Column({ comment: '用户ID', type: 'int', name: 'user_id' })
  userId: number;

  @Column({ comment: '评论人名称', type: 'varchar', name: 'user_name' })
  userName: string;

  @Column({
    comment: '回复用户姓名',
    type: 'varchar',
    name: 'reply_user_name',
    nullable: true,
  })
  replyUserName: string;

  @Column({ comment: '博客ID', type: 'int', name: 'blog_id' })
  blogId: number;

  @Column({ comment: '评论的内容', type: 'varchar', name: 'content' })
  content: string;

  @Column({
    comment: '父评论id',
    type: 'int',
    name: 'parent_comment_id',
    nullable: true,
  })
  parentCommentId: number;

  @Column({
    comment: '父评论的用户id',
    type: 'int',
    name: 'parent_comment_user_id',
    nullable: true,
  })
  parentCommentUserId: number;

  @Column({
    comment: '被回复的评论id',
    type: 'int',
    name: 'reply_comment_id',
    nullable: true,
  })
  replyCommentId: number;

  @Column({
    comment: '被回复的评论用户id',
    type: 'int',
    name: 'reply_comment_user_id',
    nullable: true,
  })
  replyCommentUserId: number;

  @Column({
    comment: '评论等级[ 1 一级评论 默认 ，2 二级评论]',
    type: 'tinyint',
    name: 'comment_level',
    default: 1,
  })
  commentLevel: number;

  @Column({
    comment: '文章标识（1：作者；2：普通用户）',
    type: 'int',
    name: 'content_flag',
    default: 2,
  })
  contentFlag: number;

  @Column({
    comment: '状态 (1 有效，0 逻辑删除)',
    type: 'tinyint',
    name: 'status',
    default: 1,
    nullable: true,
  })
  status: number;

  @Column({
    comment: '置顶状态[ 1 置顶，0 不置顶 默认 ]',
    type: 'tinyint',
    name: 'top_status',
    default: 0,
    nullable: true,
  })
  topStatus: number;

  @Column({
    comment: '点赞数',
    type: 'int',
    width: 11,
    name: 'praise_num',
    default: 0,
    nullable: true,
  })
  praiseNum: number;

  @Column({ comment: 'ip地址', name: 'ip_addr', nullable: true, length: 50 })
  ipAddr: string;
}
